package com.example.event_resource_java.authority.server;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.event_resource_java.authority.dao.EventResourceAllocationDO;
import com.example.event_resource_java.authority.dao.EventResourceAllocationsDO;
import com.example.event_resource_java.authority.dao.ModuleDao;
import com.example.event_resource_java.commons.model.CaseBody;
import com.example.event_resource_java.commons.model.PracticeRecordBody;
import com.example.event_resource_java.commons.model.TheoreticalBody;
import com.example.event_resource_java.commons.util.ApiResult;
import com.example.event_resource_java.commons.vo.*;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

public interface ResourceServer extends IService<EventResourceAllocationsDO> {
    /**
     * 首页展示全部资源
     */
    List<HomeResourceVO> getHomeResourceList();

    TitleListVO getAllocationTitleList();

    List<String> getHeadLineTitle();

    /**
     * 全部模板
     */
    List<ModuleDao> getModuleList();

    /**
     * 赛项资源查询参数
     */
    MatchRequestVO getMatchRequestParam(String eveMoId);

    /**
     * 赛项资源条件查询
     */
    PageResult getMatchResourceList(String eventName, Integer type, String time, Integer grade,
                                    Long eveMoId, Integer pageNum, Integer pageSize);

    /**
     * 获取资源详情
     */
    ApiResult getMatchResourceDetails(Long id);

    Map<String, List<EventResourceAllocationsDO>> getChildren(Long parenId);

    /**
     * 案例分析题新增
     * @param caseBody
     * @return
     */
    boolean saveOrUpdateCaseRecord(CaseBody caseBody);

    /**
     * 获取试题
     */
    ApiResult getExamination(TheoreticalBody theoreticalBody);

    ApiResult getExamination2(TheoreticalBody theoreticalBody);

    /**
     * 交卷后 根据题目id查询题目
     */
    ExamPaperVO submitPaper(PracticeRecordBody practiceRecordBody) throws ParseException;

    /**
     * 在线练习 交卷
     * @param practiceRecordBody
     * @return
     * @throws ParseException
     */
    ApiResult submitPaper2(PracticeRecordBody practiceRecordBody) throws ParseException;

    /**
     * 老师交卷 返回题目 但不存记录
     */
    ExamPaperVO teacherExamPaperDetail(PracticeRecordBody practiceRecordBody);

    /**
     * 交卷后 根据题目id查询题目
     */
    boolean update(PracticeRecordBody practiceRecordBody);

    /**
     * 继续答题
     */
    public ContinueExamVO continueExam(Long practiceRecordId);

    /**
     * 首页全局搜索
     */
    PageResult homeSearch(String searchValue, Integer pageNum, Integer pageSize);

    /** 重新练习 */
    PaperDetailVo redoPractice(Long practiceRecordId);

    /**
     * 获取所有赛项资源
     * @return
     */
    List<EventResourceAllocationDO> evens();
}
